﻿@model IEnumerable<handvn.Models.DetailCategories>
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}
@if (Request.IsAuthenticated && @Session["LoaiTaiKhoan"] != null)
{
    if (@Session["LoaiTaiKhoan"].ToString() == "admin")
    {
    <h1>
        Quản lý chi tiết danh mục</h1>
    <h2>
        Index</h2>

    <p>
        @Html.ActionLink("Create New", "Create")
    </p>
    <table>
        <tr>
            <th>
                Categories
            </th>
            <th>
                TenChiTietDanhMuc
            </th>
            <th>
                TinhTrang
            </th>
            <th>
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Categories.TenDanhMuc)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.TenChiTietDanhMuc)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.TinhTrang)
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new { id = item.DetailCategoriesID }) |
                    @Html.ActionLink("Details", "Details", new { id = item.DetailCategoriesID }) |
                    @Html.ActionLink("Delete", "Delete", new { id = item.DetailCategoriesID })
                </td>
            </tr>
        }
    </table>
    }
}
else
{
    <p>
        Xin vui lòng đăng nhập</p>
    <script type="text/javascript">
        window.location.href = "http://handvn.com/Account/Admin"
    </script>
}